package com.xgk.boot.module.core.controller.admin.product.vo.product;

import com.mzt.logapi.starter.annotation.DiffLogField;
import com.xgk.boot.framework.common.enums.CommonStatusEnum;
import com.xgk.boot.framework.common.validation.InEnum;
import com.xgk.boot.module.core.controller.admin.price.vo.PriceRuleVO;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.util.List;

@Schema(description = "管理后台 - 商品创建/更新 Request VO")
@Data
public class ProductSaveReqVO {

    @Schema(description = "商品prId", example = "1")
    private Long prId;


    @Schema(description = "商品代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "商品代码不能为空")
    @Pattern(regexp = "^[A-Za-z0-9_-]{4,20}$", message = "账号格式为4-20位数字、字母、下划线或连字符")
    @DiffLogField(name = "商品代码")
    private String prCode;
    

    @Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "商品名称不能为空")
    @DiffLogField(name = "商品名称")
    private String prName;

    @Schema(description = "供应商服务类型", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "供应商服务类型不能为空")
    @DiffLogField(name = "供应商服务类型")
    private String sp;

    @Schema(description = "供应商api")
//    @NotNull(message = "供应商服务api不能为空")
//    @DiffLogField(name = "供应商服务api")
    private String spApiId;
    

    @Schema(description = "服务状态", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "服务状态不能为空")
    @InEnum(value = CommonStatusEnum.class, message = "状态必须是 {value}")
    @DiffLogField(name = "服务状态")
    private Integer prStatus;


    @Schema(description = "基础物流费规则", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "基础物流费规则不能为空")
    @DiffLogField(name = "基础物流费规则")
    private List<PriceRuleVO> baseTradingFees;

    @Schema(description = "附加物流费规则")
    @DiffLogField(name = "基础物流费规则")
    private List<PriceRuleVO> extraTradingFees;

    @Schema(description = "商品描述")
    private String remark;

//    @Schema(description = "是否试用", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
//    @NotNull(message = "是否试用不能为空")
//    @DiffLogField(name = "是否试用")
//    private Integer spTrial;

//    @Schema(description = "押金")
//    @DiffLogField(name = "押金")
//    private String spBalance;
//
//    @Schema(description = "对接人")
//    @DiffLogField(name = "对接人")
//    private String spContactPerson;
//
//    @Schema(description = "电话")
//    @DiffLogField(name = "电话")
//    private String spContactPersonPhone;
//
//    @Schema(description = "邮箱")
//    @DiffLogField(name = "邮箱")
//    private String spContactEmail;

}